//    Copyright (C) Kherty.  All rights reserved.
using OpenLS.Core.Serialization;

namespace OpenLS.Drawing.Diagram
{
    class SampleData: IOfficeXmlSerializableAs
    {
        private bool _useDef;
        private DataModel _dataModel;

        public void ReadXmlAs(string name, ReadContext context)
        {
            using (var c = context.Read(name))
            {
                _useDef = c.GetOptionalBoolean("useDef", false);
                _dataModel = c.ReadOptionalElement<DataModel>("dataModel");
            }
    

        }

        public void WriteXmlAs(string name, WriteContext context)
        {
            using (var c = context.Write(name))
            {
                c.SetOptionalBoolean("useDef", _useDef, false);
                c.WriteOptionalElement(_dataModel);
            }
        }
    }
}